import request from '@/utils/request'
import type { ApiResponse } from '@/types/api'

// 删除考勤记录
export function deleteAttendance(id: number) {
  return request<ApiResponse<null>>({
    url: `/api/attendances/${id}`,
    method: 'delete'
  })
}

// 编辑考勤记录
export interface AttendanceEditRequest {
  date: string
  type: number
  workHours?: number
  remark?: string
}

export function updateAttendance(id: number, data: AttendanceEditRequest) {
  return request<ApiResponse<null>>({
    url: `/api/attendances/${id}`,
    method: 'put',
    data
  })
} 